var mprsCookie = (function (document) {
    /**
     * 设置Cookie
     *
     * @param {} name
     * @param {} value
     */
    var setCookie = function (name, value, minuts) {
        var argv = setCookie.arguments;
        var argc = setCookie.arguments.length;
        var expiration = new Date((new Date()).getTime() + minuts * 60000 * 60);
        document.cookie = name
            + "="
            + escape(value)
            + "; expires=" + expiration
                .toGMTString();
    };
    /**
     * 获取Cookie
     *
     * @param {} Name
     * @return {}
     */
    var getCookie = function (Name) {
        var search = Name + "="
        if (document.cookie.length > 0) {
            offset = document.cookie.indexOf(search)
            if (offset != -1) {
                offset += search.length
                end = document.cookie.indexOf(";", offset)
                if (end == -1)
                    end = document.cookie.length
                return unescape(document.cookie.substring(offset, end))
            } else
                return ""
        }
    };

    /**
     * 从缓存中清除Cookie
     *
     * @param {} name
     */
    var clearCookie = function (name) {
        var expdate = new Date();
        expdate.setTime(expdate.getTime() - (86400 * 1000 * 1));
        setCookie(name, "", expdate);
    }

    return {
        setCookie: setCookie,
        getCookie:getCookie,
        clearCookie:clearCookie
    };
})(document);